

import 'package:extra_hittest_area/extra_hittest_area.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:furaha_mkopo/commonTool/fm_color_tool.dart';

class FMCustomNavBarWidget extends StatefulWidget {

  final String title;

  const FMCustomNavBarWidget({super.key,required this.title});

  @override
  State<FMCustomNavBarWidget> createState() => _FMCustomNavBarWidgetState();
}

class _FMCustomNavBarWidgetState extends State<FMCustomNavBarWidget> {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 44,
      child: Stack(
        children: [
          Center(
            child: Text(
              widget.title,
              style: TextStyle(
                color: FMColorTool.blackColor,
                fontSize: 16,
                fontWeight: FontWeight.bold,
                decoration: TextDecoration.none,
              ),
              textAlign: TextAlign.center,
            ),
          ),
          Positioned(
            top: 9,
            left: 18,
            child: GestureDetectorHitTestWithoutSizeLimit(
              extraHitTestArea: const EdgeInsets.only(top: 9,left: 18,right: 18,bottom: 9),
              onTap: (){
                Navigator.pop(context);
              },
              child: Image.asset("assets/images/back.png",width: 24,height: 24)
            )
          )
        ],
      ),
    );
  }
}
